#include <stdio.h>
#include <stdlib.h>
typedef char hlw;
typedef struct BiNode{
	hlw data;
	struct BiNode *lch,*rch;	
}BiTNode,*BiTree;
BiTree xmzBiTree(){
	hlw ch;
	ch=getchar();
	getchar();
	BiTree T=NULL;
	if(ch!='#'){
		T=(BiTNode*)malloc(sizeof(BiTNode));
		T->data=ch;
		T->lch=xmzBiTree();
		T->rch=xmzBiTree();
		
	}
	return T;
}
void kele(BiTree T){
	
	if(T!=NULL){
		kele(T->lch);
		printf("%c",T->data);
		kele(T->rch);
	}
}//中序
void skd(BiTree T){
	
	if(T){
		printf("%c",T->data);
		skd(T->lch);		
		skd(T->rch);
	}//先序
	
}
void MOF(BiTree T){
	
	if(T){
		MOF(T->lch);
		MOF(T->rch);
		printf("%c",T->data);
	}
}
int main(){
	BiTree tree=NULL;
	printf("输入");
	tree=xmzBiTree();
	printf("这里是中序遍历");
	kele(tree);
	printf("这里是后序遍历");
	MOF(tree);
	printf("这里是先序遍历");
	skd(tree);
	return 0;
}